<template>
    <div id="app">
        <div id="nav">
            <!-- to属性写对应配置的path -->
            <router-link to="/home">Home</router-link>|
            <router-link to="/about">About</router-link>
        </div>
        <hr />
        <!-- router-link与router-view并无直接关系，router-link跳转的组件是跟to属性里的url有关 
        根据你在配置route时的层级关系，找到对应的router-view进行加载
        -->
        <router-link to="/homeTwo">home Two</router-link>|
        <router-link to="/about/aboutOne">aboutOne</router-link>
        <router-view />
    </div>
</template>

<style lang="less">
#app {
    font-family: "Avenir", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
}

// #nav {
//   padding: 30px;

//   a {
//     font-weight: bold;
//     color: #2c3e50;

//     &.router-link-exact-active {
//       color: #42b983;
//     }
//   }
// }
// .router-link-exact-active {
//     color: blue;
// }
// //完全匹配也包含精准匹配，会覆盖上面精准匹配的样式
// .router-link-active {
//     color: red;
// }
//根据url地址，
.router-link-active {
    color: red;
}
.router-link-exact-active {
    color: blue;
}
</style>
